/*
 * @Author: zhangzhen
 * @Date: 2022-07-05 13:08:37
 * @LastEditors: zhangzhen
 * @LastEditTime: 2022-10-19 14:22:18
 * @Description:
 *
 */
// 获取当前时间
export const getNowTime = () => {
  const Hour = new Date().getHours() > 9 ? String(new Date().getHours()) : '0' + new Date().getHours()
  const Minute = new Date().getMinutes() > 9 ? String(new Date().getMinutes()) : '0' + new Date().getMinutes()
  const Second = new Date().getSeconds() > 9 ? String(new Date().getSeconds()) : '0' + new Date().getSeconds()

  return {
    Hour,
    Minute,
    Second
  }
}

// 年
export const Year = new Date().getFullYear()
// 月
export const Month =
  new Date().getMonth() + 1 > 9 ? Number(new Date().getMonth()) + 1 : '0' + (new Date().getMonth() + 1)
// 日
export const Day = new Date().getDate() > 9 ? String(new Date().getDate()) : '0' + new Date().getDate()

// 星期
export const getWeekDay = () => {
  let WeekDay
  const count = new Date().getDay()
  switch (Number(count)) {
    case 0:
      WeekDay = '星期日'
      break
    case 1:
      WeekDay = '星期一'
      break
    case 2:
      WeekDay = '星期二'
      break
    case 3:
      WeekDay = '星期三'
      break
    case 4:
      WeekDay = '星期四'
      break
    case 5:
      WeekDay = '星期五'
      break
    case 6:
      WeekDay = '星期六'
      break
    default:
      WeekDay = '---'
  }

  return WeekDay
}

// 今天
export const Today = Year + '年' + Month + '月' + Day + '日'
